<?php

/*
 * @copyright :     Ienter asia Technologies
 * @author :        Quyet
 * @version         v.1.0
 * @created         18/6/2014
 * @Description :   Model Employee 
 */
if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Mmod_employee extends MYAD_Model {

    protected $table_name = 'm_employee';
    protected $table_employeesalaryinfo = 'm_employeesalaryinfo';
    protected $table_employeepitinfo = 'm_employeepitinfo';
    protected $table_employeeleaveinfo = 'm_employeeleaveinfo';
    protected $table_employeebonus = 'm_employeebonus';
    protected $table_position = 'm_position';

    function __construct() {
        parent::__construct();
    }

    /*
     * @author :        Quyet
     * @created:        18/6/2014
     * @Description:    Get all data for view of employee list
     * @Input :         Null
     * @Output :        (Array) data for view data
     */

    function getAllData($page = 0) {
        $condition = array(
            'where' => array('CompanyCode' => $this->session->userdata('CompanyCode')),
        );

        /* Load Position */
        $conditionOption = $condition;
        $conditionOption['where']['Del_Flag'] = FALSE;
        $position = $this->selectDB($this->table_position, $conditionOption);

        /* Begin set value search */
        $condition['like'] = array();
        $txtName = $this->input->post('txtName');
        if (!empty($txtName)) {
            $condition['like']['EmployeeName'] = $txtName;
        }
        $txtEmail = $this->input->post('txtEmail');
        if (!empty($txtEmail)) {
            $condition['like']['Email'] = $txtEmail;
        }
        $cboPosition = $this->input->post('cboPosition');
        if (!empty($cboPosition)) {
            $condition['where']['PositionId'] = $cboPosition;
        }
        /* End set value search */

        /* load all label */
        $labelData = $this->getLabelData();

        /* load all employee data range */
        $allEmployeeData = $this->getEmployeeData($condition);

        /* load pagination */
        $pagiData = array(
            'base_url' => base_url('employee/'),
            'total_rows' => count($allEmployeeData['data']),
        );
        $pagination = $this->config->item('pagination');
        $offset = isset($pagiData['per_page']) ? $pagiData['per_page'] : $pagination['per_page'];
        $pagi = $this->getPagination($pagiData);

        /* load employee data range */
        $condition['limit'] = array($page, $offset);
        $condition['order_by'] = 'EmployeeId DESC';
        $employeeData = $this->getEmployeeData($condition);

        $data = array(
            'show' => 'index',
            'pagi' => $pagi,
            'order' => $page,
            'position' => $position,
            'message' => $this->lang->line('emp_btnSearch_active_null'),
            'nullcharacter' => $this->lang->line('nullcharacter'),
        );

        return array_merge($data, $labelData, $employeeData);
    }

    /*
     * @author :        Quyet
     * @created:        18/6/2014
     * @Description:    Get label data of employee
     * @Input :         void
     * @Output :        (Array) data label
     */

    function getLabelData() {

        $title = $this->lang->line('emp_title');
        $table = $this->lang->line('emp_table');
        $emp_frm_lblName = $this->lang->line('emp_frm_lblName');
        $emp_frm_lblEmail = $this->lang->line('emp_frm_lblEmail');
        $emp_frm_lblPosition = $this->lang->line('emp_frm_lblPosition');
        $emp_frm_btnSearch = $this->lang->line('emp_frm_btnSearch');
        $emp_frm_btnReset = $this->lang->line('emp_frm_btnReset');

        $emp_newRegister = $this->lang->line('emp_newRegister');
        $emp_table_col_id = $this->lang->line('emp_table_col_id');
        $emp_table_col_fullName = $this->lang->line('emp_table_col_fullName');
        $emp_table_col_dateOfBirth = $this->lang->line('emp_table_col_dateOfBirth');
        $emp_table_col_IDCardNo = $this->lang->line('emp_table_col_IDCardNo');
        $emp_table_col_email = $this->lang->line('emp_table_col_email');
        $emp_table_col_position = $this->lang->line('emp_table_col_position');
        $emp_table_col_grossSalary = $this->lang->line('emp_table_col_grossSalary');
        $emp_table_col_bonus = $this->lang->line('emp_table_col_bonus');
        $emp_table_col_noOfDependant = $this->lang->line('emp_table_col_noOfDependant');
        $emp_table_col_leaveLeft = $this->lang->line('emp_table_col_leaveLeft');
        $emp_table_col_joinDate = $this->lang->line('emp_table_col_joinDate');
        $emp_table_col_status = $this->lang->line('emp_table_col_status');
        $emp_table_col_active = $this->lang->line('po_table_col_Active');


        $data = array(
            'title' => (empty($title) ? 'List Time Card' : $title),
            'table' => (empty($table) ? '' : $table),
            'frm_lblName' => (empty($emp_frm_lblName) ? 'Name' : $emp_frm_lblName),
            'frm_lblEmail' => (empty($emp_frm_lblEmail) ? 'Email' : $emp_frm_lblEmail),
            'frm_lblPosition' => (empty($emp_frm_lblPosition) ? 'Position' : $emp_frm_lblPosition),
            'frm_btnSearch' => (empty($emp_frm_btnSearch) ? 'Search' : $emp_frm_btnSearch),
            'frm_btnReset' => (empty($emp_frm_btnReset) ? 'Reset' : $emp_frm_btnReset),
            'newRegister' => (empty($emp_newRegister) ? 'New register' : $emp_newRegister),
            'table_col_id' => (empty($emp_table_col_id) ? 'Employee Id' : $emp_table_col_id),
            'table_col_fullName' => (empty($emp_table_col_fullName) ? 'Full Name' : $emp_table_col_fullName),
            'table_col_dateOfBirth' => (empty($emp_table_col_dateOfBirth) ? 'date of birth' : $emp_table_col_dateOfBirth),
            'table_col_IDCardNo' => (empty($emp_table_col_IDCardNo) ? 'ID card' : $emp_table_col_IDCardNo),
            'table_col_email' => (empty($emp_table_col_email) ? 'Email' : $emp_table_col_email),
            'table_col_position' => (empty($emp_table_col_position) ? 'Position' : $emp_table_col_position),
            'table_col_grossSalary' => (empty($emp_table_col_grossSalary) ? 'gross salary' : $emp_table_col_grossSalary),
            'table_col_bonus' => (empty($emp_table_col_bonus) ? 'Bonus' : $emp_table_col_bonus),
            'table_col_noOfDependant' => (empty($emp_table_col_noOfDependant) ? 'No of dependant' : $emp_table_col_noOfDependant),
            'table_col_leaveLeft' => (empty($emp_table_col_leaveLeft) ? 'leave left' : $emp_table_col_leaveLeft),
            'table_col_joinDatee' => (empty($emp_table_col_joinDate) ? 'Join date' : $emp_table_col_joinDate),
            'table_col_status' => (empty($emp_table_col_status) ? 'Status' : $emp_table_col_status),
            'table_col_active' => (empty($emp_table_col_active) ? 'Active' : $emp_table_col_active),
        );
        return $data;
    }

    /*
     * @author :        Quyet
     * @created:        18/6/2014
     * @Description:    Get employee data
     * @Input :         
     *                  (Array) $search Search condition
     *                  (Integer) $limit
     *                  (Integer) $offset
     * @Output :        Array data
     */

    function getEmployeeData($condition = array()) {
        /* get EmployeeData */
        $result = $this->selectDB($this->table_name, $condition);
        $temp = array();
        if (count($result)) {
            foreach ($result as $key => $item) {
                $temp[$key] = $item;

                /* set $grossSalary */
                $grossSalary = FALSE;
                $grossSalarys = $this->getBasicSalarys($item->EmployeeId);
                if ($grossSalarys) {
                    $grossSalary = $grossSalarys->GrossSalary;
                }
                $temp[$key]->grossSalary = $grossSalary;

                /* set $bonus */
                $bonus = FALSE;
                $bonuss = $this->getBonus($item->EmployeeId, $this->monthForSalary);
                if ($bonuss) {
                    $bonus = $bonuss->Bonus;
                }
                $temp[$key]->bonus = $bonus;

                /* set $dependant */
                $dependant = FALSE;
                $dependants = $this->getDependants($item->EmployeeId);
                if ($dependants) {
                    $dependant = $dependants->NumberOfDependants;
                }
                $temp[$key]->dependants = $dependant;

                /* set $leaveLeft */
                $leaveLeft = FALSE;
                $leaveLefts = $this->getLeaveInfo($item->EmployeeId, date('Y', $this->monthForSalary));
                if ($leaveLefts) {
                    $leaveLeft = $leaveLefts->AvailableLeave;
                }
                $temp[$key]->leaveLeft = $leaveLeft;
            }
        }

        return array('data' => $temp);
    }

    /*
     * @author :        Quyet
     * @created:        18/6/2014
     * @Description:    Get leave Info
     * @Input :         
     *                  (Integer) $employeeID
     *                  (Integer) $year
     * @Output :        object/False
     */

    function getLeaveInfo($employeeID = 0, $year = 0) {
        $condition = array(
            'where' => array(
                'EmployeeId' => $employeeID,
                'Year' => $year,
                'Del_Flag' => FALSE
            ),
            'first' => TRUE
        );
        return $this->selectDB($this->table_employeeleaveinfo, $condition);
    }

    /*
     * @author :        Quyet
     * @created:        19/6/2014
     * @Description:    basic data for new add employee
     * @Input :         (Interger) $id
     * @Output :        Array
     */

    function getAddEmployee($id = 0) {
        /* get language info */
        $title = ($id) ? $this->lang->line('emp_update_title') : $this->lang->line('emp_add_title');
        $dialogTitle = $this->lang->line('emp_dialog_title');
        $back = $this->lang->line('emp_add_btnBack');
        $employeeName = $this->lang->line('emp_add_txtName');
        $dateOfBirth = $this->lang->line('emp_add_txtBirth');
        $joinDate = $this->lang->line('emp_add_txtJoin');
        $email = $this->lang->line('emp_add_txtEmail');
        $phone = $this->lang->line('emp_add_txtPhone');
        $position = $this->lang->line('emp_add_cmbPosition');
        $cardID = $this->lang->line('emp_add_txtCardID');
        $address1 = $this->lang->line('emp_add_txtAddress1');
        $address2 = $this->lang->line('emp_add_txtAddress2');
        $employeeType = $this->lang->line('emp_add_cmbEmployeeType');
        $startProbationaryDate = $this->lang->line('emp_add_startProbationaryDate');
        $endProbationaryDate = $this->lang->line('emp_add_endProbationaryDate');
        $startOfficialDate = $this->lang->line('emp_add_startOfficialDate');
        $endOfficialDate = $this->lang->line('emp_add_endOfficialDate');
        $status = $this->lang->line('emp_add_chkStatus');
        $lblDelete = $this->lang->line('po_update_lblDelete');
        $submit = $this->lang->line('emp_add_btnsubmit');

        /* get config info */
        $employeeTypeList = $this->config->item('employeeType');
        $conditionPositionList = array(
            'where' => array(
                'CompanyCode' => $this->session->userdata('CompanyCode'),
                'Del_Flag' => FALSE
            ),
        );
        $employeePositionList = $this->selectDB($this->table_position, $conditionPositionList);

        /* get employee info */
        $conditionEmployee = array(
            'where' => array(
                'CompanyCode' => $this->session->userdata('CompanyCode'),
                'EmployeeId' => $id
            ),
            'first' => TRUE
        );
        $employData = $this->selectDB($this->table_name, $conditionEmployee);
        if (!isset($_POST['btnSubmit']) && $employData) {
            /* is load default */
            $emp = array(
                'txtEmployeeName' => dQuotes($employData->EmployeeName),
                'txtDateOfBirth' => $this->setDate($employData->DateOfBirth),
                'txtJoinDate' => $this->setDate($employData->JoinDate),
                'txtEmail' => dQuotes($employData->Email),
                'txtPhone' => dQuotes($employData->Phone),
                'cmbPosition' => $employData->PositionId,
                'txtidCardNumber' => dQuotes($employData->IdCardNumber),
                'txtContactAddressLine1' => dQuotes($employData->ContactAddressLine1),
                'txtContactAddreddLine2' => dQuotes($employData->ContactAddreddLine2),
                'cmbEmployeeType' => $employData->EmployeeType,
                'txtStartProbationaryDate' => $this->setDate($employData->startProbationaryDate),
                'txtEndProbationaryDate' => $this->setDate($employData->endProbationaryDate),
                'txtStartOfficialDate' => $this->setDate($employData->startOfficialDate),
                'txtEndOfficialDate' => $this->setDate($employData->endOfficialDate),
                'cmbStatus' => $employData->Status,
                'txtDelete' => $employData->Del_Flag,
            );
        } else {
            $emp = array(
                'txtEmployeeName' => set_value('txtEmployeeName'),
                'txtDateOfBirth' => set_value('txtDateOfBirth'),
                'txtJoinDate' => set_value('txtJoinDate'),
                'txtEmail' => set_value('txtEmail'),
                'txtPhone' => set_value('txtPhone'),
                'cmbPosition' => set_value('cmbPosition'),
                'txtidCardNumber' => set_value('txtidCardNumber'),
                'txtContactAddressLine1' => set_value('txtContactAddressLine1'),
                'txtContactAddreddLine2' => set_value('txtContactAddreddLine2'),
                'cmbEmployeeType' => set_value('cmbEmployeeType'),
                'txtStartProbationaryDate' => set_value('txtStartProbationaryDate'),
                'txtEndProbationaryDate' => set_value('txtEndProbationaryDate'),
                'txtStartOfficialDate' => set_value('txtStartOfficialDate'),
                'txtEndOfficialDate' => set_value('txtEndOfficialDate'),
                'cmbStatus' => set_value('cmbStatus'),
                'txtDelete' => set_value('txtDelete'),
            );
        }

        $temp = array(
            'js' => array('jquery-ui.js'),
            'css' => array('jquery-ui.css'),
            'show' => 'add_employee',
            /* set label */
            'title' => (empty($title) ? 'Add Employee' : $title),
            'dialogTitle' => (empty($dialogTitle) ? 'Notification' : $dialogTitle),
            'back' => (empty($back) ? 'Back' : $back),
            'employeeName' => (empty($employeeName) ? 'Employee Name' : $employeeName),
            'dateOfBirth' => (empty($dateOfBirth) ? 'Date of birth' : $dateOfBirth),
            'joinDate' => (empty($joinDate) ? 'Join date' : $joinDate),
            'email' => (empty($email) ? 'Email' : $email),
            'phone' => (empty($phone) ? 'Phone' : $phone),
            'position' => (empty($position) ? 'Position' : $position),
            'cardID' => (empty($cardID) ? 'Card ID' : $cardID),
            'address1' => (empty($address1) ? 'Address 1' : $address1),
            'address2' => (empty($address1) ? 'Address 2' : $address2),
            'employeeType' => (empty($employeeType) ? 'Employee type' : $employeeType),
            'startProbationaryDate' => (empty($startProbationaryDate) ? 'Start Probationary Date' : $startProbationaryDate),
            'endProbationaryDate' => (empty($endProbationaryDate) ? 'End Probationary Date' : $endProbationaryDate),
            'startOfficialDate' => (empty($startOfficialDate) ? 'Start Official Date' : $startOfficialDate),
            'endOfficialDate' => (empty($endOfficialDate) ? 'End Official Date' : $endOfficialDate),
            'status' => (empty($status) ? 'Working' : $status),
            'lblDelete' => (empty($lblDelete) ? 'Delete' : $lblDelete),
            'submit' => (empty($submit) ? 'Submit' : $submit),
            'nullcharacter' => $this->lang->line('nullcharacter'),
            /* set config */
            'employeeTypeList' => $employeeTypeList,
            'employeePositionList' => $employeePositionList,
            'minYear' => $this->session->userdata('minYear'),
            'maxYear' => $this->session->userdata('maxYear'),
            /* set data */
            'id' => ($employData) ? $id : 0,
        );
        return array_merge($temp, $emp);
    }

    /*
     * @author :        Quyet
     * @created:        20/6/2014
     * @Description:    check validate form add/edit employee
     * @Input :         void
     * @Output :        boolean
     */

    function validate() {
        /* convert */
        $_POST['txtidCardNumber'] = mb_convert_kana($_POST['txtidCardNumber'], 'a');
        $_POST['txtDateOfBirth'] = mb_convert_kana($_POST['txtDateOfBirth'], 'a');
        $_POST['txtJoinDate'] = mb_convert_kana($_POST['txtJoinDate'], 'a');
        $_POST['txtStartProbationaryDate'] = mb_convert_kana($_POST['txtStartProbationaryDate'], 'a');
        $_POST['txtEndProbationaryDate'] = mb_convert_kana($_POST['txtEndProbationaryDate'], 'a');
        $_POST['txtStartOfficialDate'] = mb_convert_kana($_POST['txtStartOfficialDate'], 'a');
        $_POST['txtEndOfficialDate'] = mb_convert_kana($_POST['txtEndOfficialDate'], 'a');


        $this->form_validation->set_error_delimiters('', '');
        $this->form_validation->set_rules('txtEmployeeName', $this->lang->line('emp_add_txtName'), 'required|max_length[255]');
        $this->form_validation->set_rules('txtDateOfBirth', $this->lang->line('emp_add_txtBirth'), 'max_length[10]|callback_validate_date');
        $this->form_validation->set_rules('txtJoinDate', $this->lang->line('emp_add_txtBirth'), 'required|max_length[10]|callback_validate_date|callback_validate_date');
        $this->form_validation->set_rules('txtEmail', $this->lang->line('emp_add_txtEmail'), 'valid_email|max_length[255]');
        $this->form_validation->set_rules('txtPhone', $this->lang->line('emp_add_txtPhone'), 'max_length[50]');
        $this->form_validation->set_rules('cmbPosition', $this->lang->line('emp_add_cmbPosition'), 'max_length[100]');
        $this->form_validation->set_rules('txtidCardNumber', $this->lang->line('emp_add_txtCardID'), 'required|max_length[255]');
        $this->form_validation->set_rules('txtContactAddressLine1', $this->lang->line('emp_add_txtAddress1'), 'max_length[255]');
        $this->form_validation->set_rules('txtContactAddressLine2', $this->lang->line('emp_add_txtAddress2'), 'max_length[255]');
        $this->form_validation->set_rules('cmbEmployeeType', $this->lang->line('emp_add_cmbEmployeeType'), 'required|integer');
        $this->form_validation->set_rules('txtStartProbationaryDate', $this->lang->line('emp_add_startProbationaryDate'), 'required|max_length[10]|callback_validate_date');
        $this->form_validation->set_rules('txtEndProbationaryDate', $this->lang->line('emp_add_endProbationaryDate'), 'required|max_length[10]|callback_validate_date|callback_lessThanDate[txtStartProbationaryDate]');
        if ($this->input->post('cmbEmployeeType')) {
            $this->form_validation->set_rules('txtStartOfficialDate', $this->lang->line('emp_add_startOfficialDate'), 'required|max_length[10]|callback_validate_date|callback_lessThanDate[txtEndProbationaryDate]');
            $this->form_validation->set_rules('txtEndOfficialDate', $this->lang->line('emp_add_endOfficialDate'), 'required|max_length[10]|callback_validate_date|callback_lessThanDate[txtStartOfficialDate]');
        } else {
            $this->form_validation->set_rules('txtStartOfficialDate', $this->lang->line('emp_add_startOfficialDate'), 'max_length[10]|callback_validate_date|callback_lessThanDate[txtEndProbationaryDate]');
            $this->form_validation->set_rules('txtEndOfficialDate', $this->lang->line('emp_add_endOfficialDate'), 'max_length[10]|callback_validate_date|callback_lessThanDate[txtStartOfficialDate]');
        }
        if ($this->input->post('txtEndOfficialDate')) {
            $this->form_validation->set_rules('txtStartOfficialDate', $this->lang->line('emp_add_startOfficialDate'), 'required');
        }

        $this->form_validation->set_rules('cmbStatus', $this->lang->line('emp_add_chkStatus'), 'integer|max_length[1]');
        $this->form_validation->set_rules('txtDelete', $this->lang->line('emp_add_btnsubmit'), 'integer|max_length[1]');
        return $this->form_validation->run();
    }

    /*
     * @author :        Quyet
     * @created:        20/6/2014
     * @Description:    update employee
     * @Input :         (Integer) $id
     * @Output :        boolean
     */

    function updateEmployee($id = 0) {
        $conditionDuplicate = array(
            'EmployeeId !=' => $id,
            'CompanyCode' => $this->session->userdata('CompanyCode'),
            'IdCardNumber' => $this->input->post('txtidCardNumber'),
            'Del_Flag' => FALSE,
        );
        $duplicate = $this->countResult($this->table_name, $conditionDuplicate);
        if ($duplicate) {
            return array(
                'flag' => FALSE,
                'message' => $this->lang->line('emp_cardid_duplicate')
            );
        }
        $data = array(
            'CompanyCode' => $this->session->userdata('CompanyCode'),
            'EmployeeName' => $this->input->post('txtEmployeeName'),
            'DateOfBirth' => $this->input->post('txtDateOfBirth'),
            'IdCardNumber' => $this->input->post('txtidCardNumber'),
            'ContactAddressLine1' => $this->input->post('txtContactAddressLine1'),
            'ContactAddreddLine2' => $this->input->post('txtContactAddreddLine2'),
            'Phone' => $this->input->post('txtPhone'),
            'Email' => $this->input->post('txtEmail'),
            'JoinDate' => $this->input->post('txtJoinDate'),
            'PositionId' => $this->input->post('cmbPosition'),
            'EmployeeType' => $this->input->post('cmbEmployeeType'),
            'startProbationaryDate' => $this->input->post('txtStartProbationaryDate'),
            'endProbationaryDate' => $this->input->post('txtEndProbationaryDate'),
            'startOfficialDate' => $this->input->post('txtStartOfficialDate'),
            'endOfficialDate' => $this->input->post('txtEndOfficialDate'),
            'Status' => $this->input->post('cmbStatus'),
            'Del_Flag' => $this->input->post('txtDelete'),
        );
        $condition = array();
        if ($id) {
            $condition['EmployeeId'] = $id;
        }
        $temp = $this->updateDB($this->table_name, $data, $condition);
        if ($temp) {
            return array(
                'flag' => TRUE,
                'message' => $this->lang->line('emp_updateDB_success')
            );
        } else {
            return array(
                'flag' => FALSE,
                'message' => $this->lang->line('emp_updateDB_fall')
            );
        }
    }

    /*
     * @author :        Quyet
     * @created:        20/6/2014
     * @Description:    get employee
     * @Input :         (Integer) $id
     * @Output :        object/false
     */

    function countEmployeeById($id = 0) {
        $condition = array(
            'EmployeeId' => $id,
            'CompanyCode' => $this->session->userdata('CompanyCode')
        );
        return $this->countResult($this->table_name, $condition);
    }

    /*
     * @author :        Quyet
     * @created:        7/7/2014
     * @Description:    get bonus of employeeID
     * @Input :         (Integer) employeeID
     *                  (Integer) $monthForSalary
     * @Output :        Object/0
     */

    function getBonus($employeeID = 0, $monthForSalary = 0) {
        $condition = 'EmployeeId = ' . $employeeID;
        $condition .= " AND MONTH(ApplyDate) = " . date('m', $monthForSalary);
        $condition .= " AND Del_Flag = 0";
        $conditions = array(
            'where' => $condition,
            'order_by' => 'ApplyDate DESC',
            'first' => TRUE
        );
        return $this->selectDB($this->table_employeebonus, $conditions);
    }

    /*
     * @author :        Quyet
     * @created:        12/6/2014
     * @Description:    get BasicSalarys of employeeID
     * @Input :         (Integer) employeeID
     * @Output :        Object/false
     */

    function getBasicSalarys($employeeID = 0) {
        $monthForSalary = $this->monthForSalary;
        $condition = 'EmployeeId = ' . $employeeID;
        $condition .= " AND ApplyDate <= '" . date('Y-m-d', $monthForSalary) . "'";
        $condition .= " AND Del_Flag = 0";
        $conditions = array(
            'where' => $condition,
            'order_by' => 'ApplyDate DESC',
            'first' => TRUE
        );
        return $this->selectDB($this->table_employeesalaryinfo, $conditions);
    }

    /*
     * @author :        Quyet
     * @created:        13/6/2014
     * @Description:    get Dependants of employeeID
     * @Input :         (Integer) employeeID
     * @Output :        object/0
     */

    function getDependants($employeeID = 0) {
        $monthForSalary = $this->monthForSalary;
        $condition = 'EmployeeId = ' . $employeeID;
        $condition .= " AND ApplyDate <= '" . date('Y-m-d', $monthForSalary) . "'";
        $condition .= " AND Del_Flag = 0";
        $conditions = array(
            'where' => $condition,
            'order_by' => 'ApplyDate DESC',
            'first' => TRUE
        );
        return $this->selectDB($this->table_employeepitinfo, $conditions);
    }

}

?>
